/* const str = `hello es2015, this is a \'string\'`;
console.log(str);

const name = "tom";
const msg = `hey, ${name}----${1 + 2}---${Math.random()}`;
console.log(msg); */

// 带标签的模板字符串
// const str1 = console.log`hello world`;

const name = "tom";
const gender = true;

function myTagFunc(strings, name, gender) {
  // strings 根据模板进行分割，并且函数参数可以依次获取到模板字符串
  const sex = gender ? "man" : "woman";
  console.log(strings, name, gender);
  return strings[0] + name + strings[1] + sex + strings[2];
}

const result = myTagFunc`hey, ${name} is a ${gender}.`;
console.log(result);
